package com.sap.apitest2.entity;

import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "Profile")
@Entity
@Table(name="t_profile")
public class Profile extends AbstractEntity{

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="profile_id")
	private Long id;
	
	@Column(name="profile_name")
	private String name;
	
	@Column(name="group_id")
	private Long groupId;
	
	@Column(name="server_id")
	private Long serverId;
	
	@Column(name="appset")
	private String appset;
	
	@Column(name="application")
	private String application;
	
	@Column(name="user")
	private String username;
	
	@Column(name="password")
	private String password;
	
	@Transient
	private Collection<Server> servers;
	
	
	
	public Long getId() {
		return id;
	}

	@Override
	public Long getKey() {
		return id;
	}
	
	
	@Override
	public void acceptValue(AbstractEntity input) {
		if(input!=null && input instanceof Profile){
			Profile param=(Profile)input;
			this.setName(param.getName());
			this.setGroupId(param.getGroupId());
			this.setServerId(param.getServerId());
			this.setAppset(param.getAppset());
			this.setApplication(param.getApplication());
			this.setUsername(param.getUsername());
			this.setPassword(param.getPassword());
		}
	}




	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getGroupId() {
		return groupId;
	}

	public void setGroupId(Long groupId) {
		this.groupId = groupId;
	}

	public Long getServerId() {
		return serverId;
	}

	public void setServerId(Long serverId) {
		this.serverId = serverId;
	}

	
	public String getAppset() {
		return appset;
	}

	public void setAppset(String appset) {
		this.appset = appset;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getApplication() {
		return application;
	}

	public void setApplication(String application) {
		this.application = application;
	}

	

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Collection<Server> getServers() {
		return servers;
	}

	public void setServers(Collection<Server> servers) {
		this.servers = servers;
	}
	
	
}
